import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/sys-admin',
    children: [
      {
        path: '/sys-admin',
        component: () => import('../views/sys-admin/AdminIndex')
      },
      {
        path: '/sys-admin/user/list',
        component: () => import('../views/sys-admin/user/UserListView')
      },
      {
        path: '/sys-admin/user/details',
        component: () => import('../views/sys-admin/user/UserDetailsView')
      },
      {
        path: '/sys-admin/order/list',
        component: () => import('../views/sys-admin/order/OrderListView')
      },
      {
        path: '/sys-admin/order/details',
        component: () => import('../views/sys-admin/order/OrderDetailsView')
      },
      {
        path: '/sys-admin/order/recycle-bin',
        component: () => import('../views/sys-admin/order/OrderRecycleBinView')
      },
      {
        path: '/sys-admin/order/recycle-bin/details',
        component: () => import('../views/sys-admin/order/RecycleOrderDetailsView')
      },
      {
        path: '/sys-admin/feedback/list',
        component: () => import('../views/sys-admin/feedback/FeedbackListView')
      },
    ]

  },
  {
    path: '/login',
    component: () => import('../views/LonginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
